﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Student_loopUpForGrade : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //Label1.Text = Session["id"].ToString();
            Label1.Text = "98820307";
        }
    }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        Label2.Text = GridView1.SelectedRow.Cells[0].Text;
        Label3.Text = GridView1.SelectedRow.Cells[2].Text;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Session["courseId"] = Label2.Text;

        if (String.IsNullOrEmpty(Label2.Text))
        {
            ScriptManager.RegisterClientScriptBlock(Button1, this.GetType(), "alert", "alert('尚未選擇課程')", true);
        }
        else
        {
            Server.Transfer("../Student/transfer/searchCourseData.aspx");
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Session["teacherId"] = Label3.Text;

        if (String.IsNullOrEmpty(Label3.Text))
        {
            ScriptManager.RegisterClientScriptBlock(Button2, this.GetType(), "alert", "alert('尚未選擇課程')", true);
        }
        else
        {
            Server.Transfer("../Student/transfer/searchTeacherData.aspx");
        }
    }
}